package com.dexilaonian.adpter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.dexilaonian.activity.Piety_card;
import com.dexilaonian.bean.PietyBean;

import java.util.List;
import java.util.zip.Inflater;

/**
 * Created by Administrator on 2018/3/28.
 */

public class PietyAdapter extends PagerAdapter{

    private final Context mContext;
    private final List<View> mBean_list;

    public PietyAdapter(Context context, List<View> bean_list) {
        mContext = context;
        mBean_list = bean_list;
    }


    @Override
    public int getCount() {
        return mBean_list.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(mBean_list.get(position));
        return mBean_list.get(position);
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(mBean_list.get(position));
    }
}
